import request from '@/utils/request'

export const fetchData = params => {
  return request({
    url: '/data',
    params
  })
}

export const fetchAreas = (id = null) => {
  return request({
    url: `/data`,
    params: {
      sources: ['areas'],
      area_id: id
    }
  })
}

export const fetchSchools = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['schools']
    }
  })
}

export const fetchFoodTypes = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['foodTypes']
    }
  })
}
